<template>
<!-- 商品详情 -->
  <div id="See" class="See">
    <header>商品详情</header>

    <el-form ref="form" :model="form" label-width="120px">
      <el-form-item label="商品名称">
        <el-input v-model="form.name"></el-input>
      </el-form-item>
      <el-form-item label="商品描述">
        <el-input v-model="form.name"></el-input>
      </el-form-item>
      <el-form-item label="当前状态">
        <el-input v-model="form.name"></el-input>
      </el-form-item>
      <el-form-item label="所属分类">
        <el-select v-model="form.region" >
          <el-option label="区域一" value></el-option>
          <el-option label="请选择一级品类" value></el-option>
        </el-select>
      </el-form-item>
      <el-form-item label="商品价格">
        <el-input v-model="form.name"></el-input>
                <span>元</span>

      </el-form-item>
      <el-form-item label="商品库存">
        <el-input v-model="form.name"></el-input>
        <span>件</span>
      </el-form-item>
      <el-form-item label="商品图片">
        <el-upload
          action="https://jsonplaceholder.typicode.com/posts/"
          list-type="picture-card"
          :on-preview="handlePictureCardPreview"
          :on-remove="handleRemove"
        >
          <i class="el-icon-plus"></i>
        </el-upload>
        <el-dialog :visible.sync="dialogVisible">
          <img width="100%" :src="dialogImageUrl" alt />
        </el-dialog>
      </el-form-item>

      <el-form-item label="商品详情">
        <el-input type="textarea" v-model="form.desc"></el-input>
      </el-form-item>
    </el-form>
  </div>
</template>

<script>


export default {
  props: {},
  name: "See",
  data() {
    return {
      form: {
        name: "",
        region: "",
        date1: "",
        date2: "",
        delivery: false,
        type: [],
        resource: "",
        desc: "",
      },
      list: {
        subImages: "",
      },
      fileList: [
        {
          name: "food.jpeg",
          url:
            "https://fuss10.elemecdn.com/3/63/4e7f3a15429bfda99bce42a18cdd1jpeg.jpeg?imageMogr2/thumbnail/360x360/format/webp/quality/100",
        },
        {
          name: "food2.jpeg",
          url:
            "https://fuss10.elemecdn.com/3/63/4e7f3a15429bfda99bce42a18cdd1jpeg.jpeg?imageMogr2/thumbnail/360x360/format/webp/quality/100",
        },
      ],
      dialogImageUrl: "",
      dialogVisible: false,
    };
  },
  created() {},
  computed: {},
  components: {},
  methods: {
    onSubmit() {
      console.log("submit!");
    },
    handleRemove(file, fileList) {
      console.log(file, fileList);
    },
    // 图片 上传
    handlePictureCardPreview(file) {
      this.dialogImageUrl = file.url;
      this.dialogVisible = true;
    },
  },
  mounted() {
    l.then((data) => {
      console.log(data);
    });
  },
  watch: {},
};
</script>
<style scoped lang="scss">
header {
  width: 100%;
  height: 50px;
  line-height: 50px;
  font-size: 26px;
  text-indent: 20px;
}
.el-form {
  .el-input {
    width: 60%;
    .el-input__inner {
      width: 50%;
      background: #000;
    }
  }
}
</style>